package com.kt.springbootdemo2.controller;

import com.kt.springbootdemo2.entil.UserVo;

import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@Log4j2
public class IndexController   {

    @RequestMapping(value = "/index.json")
    @ResponseBody
    public Map<String,Object> indexTest(){
        Map<String,Object> returnMap=new HashMap<>(16);
        returnMap.put("code","0000");
        returnMap.put("message","操作成功");
        returnMap.put("data", UserVo.builder().age(20).userName("咸鱼").build());
        log.info("响应数据:{}",returnMap);
        return returnMap;

    }
}
